<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="system.bean.ModuleDocument" %>
<%@page import="util.PageList"%>
<%@page import="system.bean.ModuleFile"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ArrayList<ModuleFile> myDocList = null;
PageList pageBean = (PageList)request.getAttribute("pageBean");
if(null != request.getAttribute("fileList") ){
	myDocList = (ArrayList<ModuleFile>)request.getAttribute("fileList");
}

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NETCONF Development Toolkit</title>
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/index.css" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/items.css" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/subItems.css" />
    <script type="text/javascript"  src="<%=basePath%>jstree-v.pre1.0/_lib/jquery.js"></script>
    <script type="text/javascript"  src="<%=basePath%>js/StringUtil.js"></script>
	
  </head>
<body style="margin:0px; padding:0px;">
   <jsp:include page="../navigater.jsp"></jsp:include>
   
    <div class="mainContent">
        <div class="itemTitle">  Document Search </div>
        <form id="searchMemberForm"  action = "GetFiledDocServlet"   method="get">
        <div class="ListItem">
        	<span class="textSpan" style="width:180px;"> 请输入模型名称：</span>
    	 	<input class="inputText" style=" height:18px;"  id="search_key" name="search_key" /> 
    	 	<input type="submit" name="Submit" value="查找" onclick="" /> 
    	 	<input type="submit" name="Submit" value="清除查询" onclick="" /> 
        </div>
        </form>
    	<div class="itemTitle"> Document List </div>
	      <% if(null != myDocList ){
	            Iterator<ModuleFile> it = myDocList.iterator();
	             while(it.hasNext()){
	                 ModuleFile  mDoc = it.next();
	      %>
	      <div class="ListItem">
			   <span class="ListSpan"><%=mDoc.getFileName() %></span>
			   <span class="ListSpan"></span>
			   <a href="OpenDocumentServlet?_docId=<%=mDoc.getFileId() %>&op_from=op_Audit&isFiled=isFiled" >
			   		<img class="listDocImg" src="<%=basePath%>images/open_document.jpg" />Open
			   </a>&nbsp;&nbsp;
			   <a href="ExportDocumentServlet?_fileType=xml&isFiled=isFiled&_docId=<%=mDoc.getFileId() %>" >
			   		<img class="listDocImg" src="<%=basePath%>images/export_document.jpg" />Xml
			   </a>&nbsp;&nbsp;
			   <a href="ExportDocumentServlet?_fileType=yang&isFiled=isFiled&_docId=<%=mDoc.getFileId() %>" >
			   		<img class="listDocImg" src="<%=basePath%>images/export_document.jpg" />Yang
			   </a>&nbsp;&nbsp;
			   <a href="ExportNativeDescrServlet?_docId=<%=mDoc.getFileId() %>&isFiled=isFiled" >
			   		<img class="listDocImg" src="<%=basePath%>images/export_document.jpg" />Description
			   </a>&nbsp;&nbsp;
			   
		  </div>
	      <%    
	            }
	       } 
	       %>
         <% if(null != pageBean) {%>
	     <div class="ListItem">
	       <div  style="text-align:right;">
	       <%= PageList.getnumpagelist("GoToIndexServlet","1=1",pageBean) %>
	       </div>
	     </div>
	     <%} %>
	      <% if(null != request.getAttribute("msgList")) { %>
		 <div class="ListItem" align = "center">
		 	  <span class="noticeSpan"> <%=request.getAttribute("msgList") %> </span>
		 </div>
		 <% } %>
	    
    </div>
    <form id="DeleteDocForm" action="DeleteDocumentServlet" method="get">
    	<input type="hidden" id="_docIdForDelete" name="_docIdForDelete" value="" />
   	</form>
  </body>
</html>